package com.ruoyi.milk.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.milk.mapper.ExMilkMapper;
import com.ruoyi.milk.domain.ExMilk;
import com.ruoyi.milk.service.IExMilkService;

/**
 * 牛奶管理-子菜单Service业务层处理
 * 
 * @author 董虹妤
 * @date 2024-04-11
 */
@Service
public class ExMilkServiceImpl implements IExMilkService 
{
    @Autowired
    private ExMilkMapper exMilkMapper;

    /**
     * 查询牛奶管理-子菜单
     * 
     * @param id 牛奶管理-子菜单主键
     * @return 牛奶管理-子菜单
     */
    @Override
    public ExMilk selectExMilkById(Long id)
    {
        return exMilkMapper.selectExMilkById(id);
    }

    /**
     * 查询牛奶管理-子菜单列表
     * 
     * @param exMilk 牛奶管理-子菜单
     * @return 牛奶管理-子菜单
     */
    @Override
    public List<ExMilk> selectExMilkList(ExMilk exMilk)
    {
        return exMilkMapper.selectExMilkList(exMilk);
    }

    /**
     * 新增牛奶管理-子菜单
     * 
     * @param exMilk 牛奶管理-子菜单
     * @return 结果
     */
    @Override
    public int insertExMilk(ExMilk exMilk)
    {
        exMilk.setCreateTime(DateUtils.getNowDate());
        return exMilkMapper.insertExMilk(exMilk);
    }

    /**
     * 修改牛奶管理-子菜单
     * 
     * @param exMilk 牛奶管理-子菜单
     * @return 结果
     */
    @Override
    public int updateExMilk(ExMilk exMilk)
    {
        exMilk.setUpdateTime(DateUtils.getNowDate());
        return exMilkMapper.updateExMilk(exMilk);
    }

    /**
     * 批量删除牛奶管理-子菜单
     * 
     * @param ids 需要删除的牛奶管理-子菜单主键
     * @return 结果
     */
    @Override
    public int deleteExMilkByIds(Long[] ids)
    {
        return exMilkMapper.deleteExMilkByIds(ids);
    }

    /**
     * 删除牛奶管理-子菜单信息
     * 
     * @param id 牛奶管理-子菜单主键
     * @return 结果
     */
    @Override
    public int deleteExMilkById(Long id)
    {
        return exMilkMapper.deleteExMilkById(id);
    }
}
